//
//  JSXyfkViewController.m
//  JSMY
//
//  Created by 李建侯 on 2017/10/16.
//  Copyright © 2017年 jsmysoft. All rights reserved.
//  响应反馈

#import "JSXyfkViewController.h"

@interface JSXyfkViewController ()

@property (nonatomic, strong) NSArray *wbnrArray;
@property (nonatomic, strong) NSArray *wbnrnumberArray;  //抢险人数
@property (nonatomic, strong) NSArray *wbnrnumberTArray;  //抢险人数
@property (nonatomic, strong) UILabel *fjLabel;  //分局
@property (nonatomic, strong) UILabel *rsLabel;  //人数
@property (nonatomic, strong) UILabel *msLabel;  //描述

@end

@implementation JSXyfkViewController

- (void)viewDidLoad {
    [super viewDidLoad];

    /*! 布局 */
    [self setupUi];
    
    _wbnrArray = @[@"洪湖分局",@"立即转移",@"2016-09-15 09:10:10",@"2016-09-15 09:10:10",@"2016-09-15 09:10:10"];
    _wbnrnumberArray = @[@"5",@"5",@"5",@"5",@"5"];
    _wbnrnumberTArray = @[@"5",@"5",@"5",@"5",@"5"];
}

-(void)setupUi{
    
    CGFloat margin = 10;
    CGFloat left = 10;
    
    // 1.创建UIScrollView
    _scrollView = [[UIScrollView alloc] init];
    _scrollView.frame = CGRectMake(0, 0, kScreenWidth, kScreenHeigth);
    _scrollView.backgroundColor = kColor(241, 241, 241);
    [self.view addSubview:_scrollView];
    _scrollView.showsHorizontalScrollIndicator = NO;
    _scrollView.showsVerticalScrollIndicator = NO;
    _scrollView.bounces = NO;
    
    /*!头部视图 */
    UIView *topView = [[UIView alloc] initWithFrame:CGRectMake(0, margin, kScreenWidth, 40*5)];
    topView.backgroundColor = JSKit_Color_White;
    [_scrollView addSubview:topView];
    
    NSArray *wbArray = @[@"响应名称",@"响应等级",@"开始时间",@"截止时间",@"反馈时间"];
    for (int i = 0; i < wbArray.count; i++) {
        UILabel *nameLabel = [[UILabel alloc] init];
        nameLabel.frame = CGRectMake(left, 40*i, 80, 40);
        nameLabel.textColor = JSKit_Color_Gray_4;
        nameLabel.textAlignment = NSTextAlignmentCenter;
        nameLabel.text = wbArray[i];
        nameLabel.font = [UIFont systemFontOfSize:16];
        [topView addSubview:nameLabel];
    }
    
    for (int i = 0; i < wbArray.count; i++) {
        UIView *lineView = [[UIView alloc] initWithFrame:CGRectMake(left, 40*i, kScreenWidth-20, 1)];
        lineView.backgroundColor = kColor(237, 237, 237);
        [topView addSubview:lineView];
    }
    
    _wbnrArray = @[@"洪湖分局",@"立即转移",@"2016-09-15 09:10:10",@"2016-09-15 09:10:10",@"2016-09-15 09:10:10"];
    for (int i = 0; i < _wbnrArray.count; i++) {
        UILabel *nameLabel = [[UILabel alloc] init];
        nameLabel.frame = CGRectMake(100+40, 40*i, kScreenWidth-100-40, 40);
        nameLabel.textColor = JSKit_Color_Gray_4;
        nameLabel.textAlignment = NSTextAlignmentLeft;
        nameLabel.text = _wbnrArray[i];
        nameLabel.font = [UIFont systemFontOfSize:16];
        [topView addSubview:nameLabel];
    }

    /*!中间视图 */
    UIView *middleView = [[UIView alloc] initWithFrame:CGRectMake(0, margin*2+40*5, kScreenWidth, 40*5)];
    middleView.backgroundColor = JSKit_Color_White;
    [_scrollView addSubview:middleView];
    
    UIView *leftView = [[UIView alloc] init];
    leftView.backgroundColor = kColor(83, 152, 247);
    [middleView addSubview:leftView];
    
    [leftView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(0);
        make.top.mas_equalTo(margin+5);
        make.size.mas_equalTo(CGSizeMake(5, 20));
    }];

    UILabel *xpgzLabel = [[UILabel alloc] init];
    xpgzLabel.text = @"下派工作组";
    xpgzLabel.font = JS_FontSize(16);
    xpgzLabel.textColor = JSKit_Color_Gray_1;
    [middleView addSubview:xpgzLabel];
    
    [xpgzLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(leftView.mas_right).with.offset(left);
        make.top.mas_equalTo(margin);
        make.size.mas_equalTo(CGSizeMake(100, 30));
    }];
    
    _fjLabel = [[UILabel alloc] init];
    _fjLabel.text = @"洪湖分局";
    _fjLabel.font = JS_FontSize(16);
    _fjLabel.textColor = kColor(83, 152, 247);
    [middleView addSubview:_fjLabel];
    
    [_fjLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(100+40);
        make.top.mas_equalTo(margin);
        make.size.mas_equalTo(CGSizeMake(80, 30));
    }];

    UIView *rightlineView = [[UIView alloc] init];
    rightlineView.backgroundColor = kColor(237, 237, 237);
    [middleView addSubview:rightlineView];
    
    [rightlineView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(_fjLabel.mas_right).with.offset(20);
        make.top.mas_equalTo(margin+5);
        make.size.mas_equalTo(CGSizeMake(1,20));
    }];

    UILabel *rsLabel = [[UILabel alloc] init];
    rsLabel.text = @"人数";
    rsLabel.font = JS_FontSize(16);
    rsLabel.textColor = JSKit_Color_Gray_1;
    [middleView addSubview:rsLabel];
    
    [rsLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(rightlineView.mas_right).with.offset(20);
        make.top.mas_equalTo(margin);
        make.size.mas_equalTo(CGSizeMake(40, 30));
    }];
    
    _rsLabel = [[UILabel alloc] init];
    _rsLabel.text = @"5人";
    _rsLabel.font = JS_FontSize(16);
    _rsLabel.textColor = JSKit_Color_Gray_1;
    [middleView addSubview:_rsLabel];
    
    [_rsLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(rsLabel.mas_right).with.offset(20);
        make.top.mas_equalTo(margin);
        make.size.mas_equalTo(CGSizeMake(30, 30));
    }];
    
    NSArray *qxrsArray = @[@"投入抢险人数",@"已转移群众",@"洪水围困群众",@"为转移受困群众",@"失踪人数"];
    for (int i = 0; i < qxrsArray.count; i++) {
        UILabel *nameLabel = [[UILabel alloc] init];
        nameLabel.frame = CGRectMake(left+5, 30*i+40, 100, 30);
        nameLabel.textColor = JSKit_Color_Gray_4;
        nameLabel.textAlignment = NSTextAlignmentLeft;
        nameLabel.text = qxrsArray[i];
        nameLabel.font = [UIFont systemFontOfSize:14];
        [middleView addSubview:nameLabel];
    }
    
    _wbnrnumberArray = @[@"5",@"5",@"5",@"5",@"5"];
    for (int i = 0; i < _wbnrnumberArray.count; i++) {
        UILabel *nameMLabel = [[UILabel alloc] init];
        nameMLabel.frame = CGRectMake(left*2+100+30, 30*i+40, 100, 30);
        nameMLabel.textColor = JSKit_Color_Gray_4;
        nameMLabel.textAlignment = NSTextAlignmentLeft;
        nameMLabel.text = _wbnrnumberArray[i];
        nameMLabel.font = [UIFont systemFontOfSize:14];
        [middleView addSubview:nameMLabel];
    }
    
    for (int i = 0; i < _wbnrnumberArray.count; i++) {
        UIView *lineView = [[UIView alloc] initWithFrame:CGRectMake(left, 40+30*i+20+10, kScreenWidth-20, 1)];
        lineView.backgroundColor = kColor(237, 237, 237);
        [middleView addSubview:lineView];
    }

    for (int i = 0; i < _wbnrnumberArray.count; i++) {
        UIView *lineView = [[UIView alloc] initWithFrame:CGRectMake(kScreenWidth/2, 40+30*i+20+10, 1, 30)];
        lineView.backgroundColor = kColor(237, 237, 237);
        [middleView addSubview:lineView];
    }
    
    NSArray *qxrsMArray = @[@"需要转移群众",@"未转移群众",@"已转移受困群众",@"死亡人数",@"倒塌房屋"];
    for (int i = 0; i < qxrsMArray.count; i++) {
        UILabel *nameLabel = [[UILabel alloc] init];
        nameLabel.frame = CGRectMake(kScreenWidth/2+20, 30*i+40, 100, 30);
        nameLabel.textColor = JSKit_Color_Gray_4;
        nameLabel.textAlignment = NSTextAlignmentLeft;
        nameLabel.text = qxrsMArray[i];
        nameLabel.font = [UIFont systemFontOfSize:14];
        [middleView addSubview:nameLabel];
    }
    
    _wbnrnumberTArray = @[@"5",@"5",@"5",@"5",@"5"];

    for (int i = 0; i < _wbnrnumberTArray.count; i++) {
        UILabel *nameMTLabel = [[UILabel alloc] init];
        nameMTLabel.frame = CGRectMake(kScreenWidth/2+100+20+20, 30*i+40, 100, 30);
        nameMTLabel.textColor = JSKit_Color_Gray_4;
        nameMTLabel.textAlignment = NSTextAlignmentLeft;
        nameMTLabel.text = _wbnrnumberTArray[i];
        nameMTLabel.font = [UIFont systemFontOfSize:14];
        [middleView addSubview:nameMTLabel];
    }
    
    /*!底部视图 */
    UIView *bottomView = [[UIView alloc] initWithFrame:CGRectMake(0, margin*3+40*5+40*5  , kScreenWidth, 200)];
    bottomView.backgroundColor = JSKit_Color_White;
    [_scrollView addSubview:bottomView];
    
    UILabel *msLabel = [[UILabel alloc] init];
    msLabel.textColor = JSKit_Color_Gray_4;
    msLabel.textAlignment = NSTextAlignmentLeft;
    msLabel.text = @"描述";
    msLabel.font = [UIFont systemFontOfSize:14];
    [bottomView addSubview:msLabel];
    
    [msLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(left);
        make.top.mas_equalTo(margin);
        make.size.mas_equalTo(CGSizeMake(100, 30));
    }];
    
    /*!底部视图 */
    UIView *bottomlineView = [[UIView alloc] init];
    bottomlineView.backgroundColor = kColor(237, 237, 237);
    [bottomView addSubview:bottomlineView];
    
    [bottomlineView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(0);
        make.top.mas_equalTo(msLabel.mas_bottom).with.offset(margin);
        make.size.mas_equalTo(CGSizeMake(kScreenWidth,1));
    }];
    
    
    _msLabel = [[UILabel alloc] init];
    _msLabel.textColor = JSKit_Color_Gray_4;
    _msLabel.textAlignment = NSTextAlignmentLeft;
    _msLabel.numberOfLines = 0;
    _msLabel.text = @"描述大大描述大大描述大大描述大大描述大大描述大大描述大大描述大大描述大大描述大大描述大大描述大大描述大大描述大大描述大大描述大大";
    _msLabel.font = [UIFont systemFontOfSize:14];
    [bottomView addSubview:_msLabel];
    
    [_msLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(left);
        make.top.mas_equalTo(bottomlineView.mas_bottom).with.offset(margin);
        make.size.mas_equalTo(CGSizeMake(kScreenWidth-20,60));
    }];

    _scrollView.contentSize = CGSizeMake(0, margin*3+40*5+40*5 +200+64);
}

@end
